#include "threadPool.h"
int threadPoolInit(threadPool_t *pThreadPool, int workerNum){
    bzero(pThreadPool, sizeof(pThreadPool));
    pThreadPool->threadNum = workerNum;
    
    pThreadPool->tidArr = (pthread_t *)calloc(workerNum, sizeof(pthread_t));

    pThreadPool->userQueue.pFront = NULL;
    pThreadPool->userQueue.pRear = NULL;
    pThreadPool->userQueue.size = 0;

    pthread_mutex_init(&pThreadPool->mutex, NULL);
    pthread_cond_init(&pThreadPool->cond, NULL);

    pThreadPool->isThreadPoolRunning = 1;
}